// 接口管理
import {
  post,
  postOnlyUrl
} from './http'
/*
params {object} [请求是携带的参数对象]
*/
//登录接口
const loginPort = params => {
  return post('AjaxUser/Login.cspx', params);
};
//更改密码接口
const alterPW = params => {
  return post('AjaxUser/ResetPwd.cspx', params);
};
//获取大区、省份、城市接口
const area = () => {
  return postOnlyUrl('AjaxCommon/GetUserAreaInfo.cspx');
};
//用户设置表格接口
const userSetList = params => {
  return post('AjaxUser/GetUserList.cspx', params);
};
//仪器设置表格接口
const instrumentSetList = params => {
  return post("AjaxEquipment/GetList.cspx", params);
};
//大区设置表格接口
const regionSetList = params => {
  return post("AjaxArea/GetAreaList.cspx", params);
};
//医院设置表格接口
const hospitalSetList = params => {
  return post("AjaxDept/GetDeptList.cspx", params);
};
//故障设置表格接口
const faultSetList = params => {
  return post("AjaxError/GetList.cspx", params)
};
//仪器类型表格接口
const instumentTypeList = params => {
  return post("AjaxCommon/GetETypeList.cspx", params);
};
//医院模糊查询接口
const hospitalQuest = params => {
  return post("AjaxDept/GetDeptList.cspx", params);
};
//负责人模糊查询接口
const principalQuest = params => {
  return post("AjaxUser/GetUserList.cspx", params);
};
//大区、省市接口
const areaCityQuest = params => {
  return post("AjaxCommon/GetCommonAreaData.cspx", params);
};
//用户设置-增加数据
const addUserSetData = params => {
  return post("AjaxUser/Add.cspx", params);
};
//用户设置-修改数据
const alterUserSetData = params => {
  return post("AjaxUser/Edit.cspx", params);
};
//仪器设置-添加数据
const addInsData = params => {
  return post("AjaxEquipment/Add.cspx", params);
};
//仪器设置-修改数据
const alterInsData = params => {
  return post("AjaxEquipment/Edit.cspx", params);
};
//大区设置-添加数据
const areaSetAddData = params => {
  return post("AjaxArea/Add.cspx", params);
};
//大区设置-修改数据
const areaSetAlterData = params => {
  return post("AjaxArea/Edit.cspx", params);
};
//医院设置-添加数据
const hospitalAddData = params => {
  return post("AjaxDept/AddDept.cspx", params);
};
//医院设置-修改数据
const hospitalAlterData = params => {
  return post("AjaxDept/Edit.cspx", params);
};
//故障设置-添加数据
const faultSetAddData = params => {
  return post("AjaxError/Add.cspx", params);
};
//故障设置-修改数据
const faultSetAlterData = params => {
  return post("AjaxError/Edit.cspx", params);
};
//仪器类型-添加接口
const insTypeAddData = params => {
  return post("AjaxEType/Add.cspx", params);
};

//用户设置-删除接口
const userSetDelete = params => {
  return post("AjaxUser/Edit.cspx", params);
};
//大区设置-删除接口
const regionSetDelete = params => {
  return post("AjaxArea/Edit.cspx", params);
};
//故障设置-删除接口
const faultSetDelete = params => {
  return post("AjaxError/Edit.cspx", params)
};
//试剂查询-表格数据
const reagentDataList = params => {
  return post("AjaxReagent/GetDataList.cspx", params);
};
//维护查询-表格数据
const maintainTableData = params => {
  return post("AjaxEquipment/GetMaintenanceList.cspx", params);
}

//故障查询-表格数据
const faultTableData = params => {
  return post("AjaxError/GetRealTimeList.cspx", params); //AjaxError/GetRealTimeList.cspx
};
//仪器状态-表格数据
const insStateTableData = params => {
  return post("AjaxEquipment/GetStatusList.cspx", params);
}
//首页-开机数、样本数、停机数
const homeStateTotal = () => {
  return postOnlyUrl("AjaxChartIndex/GetBasicInfo.cspx");
}
//首页-维护仪器
const homeMaintainIns = () => {
  return postOnlyUrl("AjaxChartIndex/GetTodayMaintenanceList.cspx");
}
//首页-停机故障
const homeHaltFault = () => {
  return postOnlyUrl("AjaxChartIndex/GetTodayWarningList.cspx");
}
//首页-日历饼图
const homeCalendarPie = () => {
  return postOnlyUrl("AjaxChartIndex/GetWeekData.cspx");
}
//首页-故障曲线
const homeFaultLine = () => {
  return postOnlyUrl("AjaxChartIndex/ErrorLine.cspx");
}
//首页-今日试剂消耗排行
const hometodayreagent = () => {
  return postOnlyUrl("AjaxChartIndex/GetTodayReagentData.cspx");
}
//维护-周、月、季、总维护/完成接口
const mtnBaseTotal = () => {
  return postOnlyUrl("AjaxChartEquipment_Maintenance/GetBasic.cspx");
}
//维护-近一周总维护
const weekTotalMaintain = () => {
  return postOnlyUrl("AjaxChartEquipment_Maintenance/GetWeekBarData.cspx");
}
//维护-近一周维护列表
const weekMaintainList = () => {
  return postOnlyUrl("AjaxChartEquipment_Maintenance/GetWeekTableSData.cspx");
}
//维护-仪器本周、本月、本季维护
const instrumentMaintain = params => {
  return post("AjaxChartEquipment_Maintenance/GetMaintenanceLine.cspx", params);
}
//维护-大区周、月、季维护
const regionMaintain = params => {
  return post("AjaxChartEquipment_Maintenance/GetAreaCityBar.cspx", params);
}
//维护-大区维护周、月、季未完成城市饼图
const unfinishedCity = params => {
  return post("AjaxChartEquipment_Maintenance/GetCityPie.cspx", params);
}
//故障-今日所有故障总数
const todayFaultTotal = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/GetTodayTotalTb.cspx");
}
//故障-近一周等级维护
const weekFaultClass = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/GetWeekLevelPie.cspx");
}
//故障-故障统计日历饼图
const faultCalendarPie = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/GetWeekPie.cspx");
}
//故障-本周大区停机故障抓状图
const weekHaltFault = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/GetAreaStopErrorBar.cspx");
}
//故障-本周大区停机故障饼图
const weekHaltFaultPie = params => {
  return post("AjaxChartEquipment_Error/GetCityStopErrorPie.cspx", params);
}
//故障-月内停机故障图
const mothHaltFault = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/GetMonthStopBar.cspx");
}
//故障-月内停机故障图
const mothHaltFaultLine = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/LastMothErrorLine.cspx");
}
//故障-近一周故障等级统计
const weekFaultClassBar = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/LastWeekErrorBar.cspx");
}
const weekHaltFaultBar = () => {
  return postOnlyUrl("AjaxChartEquipment_Error/LastWeekEquipmentErrorBar.cspx");
}
//试剂-今日、仪器类型试剂消耗量
const todeyInsTypeConsume = () => {
  return postOnlyUrl("AjaxChartReagent/GetTodayInfo.cspx");
}
//试剂-1-12月试剂消耗量
const yearReagentConsume = params => {
  return post("AjaxChartReagent/GetReagentYearTb.cspx", params);
}
//试剂-各城市试剂消耗排行
const cityReagentConsume = params => {
  return post("AjaxChartReagent/GetCityReagentTb.cspx", params);
}
//试剂-本月前十试剂消耗排行
const MonthTop10Consume = params => {
  return post("AjaxChartReagent/Top10Bar.cspx", params);
}
//试剂----1-12月试剂消耗量折线图
const yearReagentConsumeLine = () => {
  return postOnlyUrl("AjaxChartReagent/GetReagentYearLine.cspx");
}
//仪器-各城市仪器列表详情
const cityInstrumentList = params => {
  return post("AjaxChartEquipment_Basic/GetBasicTb.cspx", params);
}
//仪器-仪器基本信息
const instrumentBaseInfo = params => {
  return post("AjaxChartEquipment_Basic/GetOneInfo.cspx", params);
}






export {
  loginPort,
  alterPW,
  area,
  userSetList, //设置页面的接口开始
  instrumentSetList,
  regionSetList,
  hospitalSetList,
  faultSetList,
  instumentTypeList,
  hospitalQuest,
  areaCityQuest,
  principalQuest,
  addUserSetData,
  alterUserSetData,
  addInsData,
  alterInsData,
  areaSetAddData,
  areaSetAlterData,
  hospitalAddData,
  hospitalAlterData,
  faultSetAddData,
  faultSetAlterData,
  insTypeAddData,
  userSetDelete,
  regionSetDelete,
  faultSetDelete,
  reagentDataList, //数据查询接口开始
  maintainTableData,
  faultTableData,
  insStateTableData,
  homeStateTotal, //首页接口开始
  homeCalendarPie,
  homeFaultLine,
  homeMaintainIns,
  homeHaltFault,
  hometodayreagent,
  mtnBaseTotal, //维护接口开始
  weekTotalMaintain,
  weekMaintainList,
  instrumentMaintain,
  regionMaintain,
  unfinishedCity,
  todayFaultTotal, //故障接口开始
  faultCalendarPie,
  weekHaltFault,
  weekHaltFaultPie,
  weekFaultClass,
  mothHaltFault,
  mothHaltFaultLine,
  weekFaultClassBar,
  weekHaltFaultBar,
  todeyInsTypeConsume, //试剂接口开始
  yearReagentConsume,
  cityReagentConsume,
  MonthTop10Consume,
  yearReagentConsumeLine,
  cityInstrumentList, //仪器接口开始
  instrumentBaseInfo

}